package com.mianyang.zhangsan.controller;

import com.mianyang.zhangsan.common.base.BaseController;
import com.mianyang.zhangsan.common.base.R;
import com.mianyang.zhangsan.service.ISecPaperExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/export")
public class SecExportController extends BaseController {
    @Autowired
    private ISecPaperExportService paperExportService;

    @GetMapping("/paper/{paperInstId}")
    public R exportPaper(@PathVariable("paperInstId") Long paperInstId) {
        String downloadPath = paperExportService.generateAndUpload(paperInstId);
        return success("path", downloadPath);
    }
}
